package com.sanen.flyer.entity;

import com.sanen.flyer.common.Constant;
import com.sanen.flyer.main.Game;
import com.sanen.flyer.tool.Console;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.Serializable;

/**
 * @author wsse
 * @date 2018-09-05 9:57
 */
public abstract class FlyObject extends Console implements Serializable{
    protected int count;
    protected BufferedImage image;
    protected int x, y;//坐标
    protected double speedx, speedy;//当前速度
    protected double sumx, sumy;
    protected int width,height;
    protected int windowWidth,windowHeight;
    protected int paddingL,paddingR,paddingT,paddingB;//四边碰撞无效区域
    protected int orientation;
    protected boolean isRemove;//待移除
    protected int hp,HP;
    protected int ap;//攻击
    /**
     * 绘图
     * @param g 画笔
     */
    public void draw(Graphics g){
        g.setClip(0,0, Constant.getWindowWidth(), Constant.getWindowHeight());
    }

    /**
     * 逻辑
     */
    public abstract void logic();

    /**
     * 移动
     */
    public abstract void move();

    /**
     * 出界
     * @return
     */
    public abstract boolean outOfBounds();

    /**
     * 接触边界
     * @return
     */
    public abstract boolean touchBounds();

    public BufferedImage getImage() {
        return image;
    }

    public void setImage(BufferedImage image) {
        this.image = image;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public double getSpeedx() {
        return speedx;
    }

    public void setSpeedx(double speedx) {
        this.speedx = speedx;
    }

    public double getSpeedy() {
        return speedy;
    }

    public void setSpeedy(double speedy) {
        this.speedy = speedy;
    }

    public double getSumx() {
        return sumx;
    }

    public void setSumx(double sumx) {
        this.sumx = sumx;
    }

    public double getSumy() {
        return sumy;
    }

    public void setSumy(double sumy) {
        this.sumy = sumy;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWindowWidth() {
        return windowWidth;
    }

    public void setWindowWidth(int windowWidth) {
        this.windowWidth = windowWidth;
    }

    public int getWindowHeight() {
        return windowHeight;
    }

    public void setWindowHeight(int windowHeight) {
        this.windowHeight = windowHeight;
    }

    public int getPaddingL() {
        return paddingL;
    }

    public void setPaddingL(int paddingL) {
        this.paddingL = paddingL;
    }

    public int getPaddingR() {
        return paddingR;
    }

    public void setPaddingR(int paddingR) {
        this.paddingR = paddingR;
    }

    public int getPaddingT() {
        return paddingT;
    }

    public void setPaddingT(int pddingT) {
        this.paddingT = pddingT;
    }

    public int getPaddingB() {
        return paddingB;
    }

    public void setPaddingB(int paddingB) {
        this.paddingB = paddingB;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getOrientation() {
        return orientation;
    }

    public void setOrientation(int orientation) {
        this.orientation = orientation;
    }

    public boolean isRemove() {
        return isRemove;
    }

    public void setRemove(boolean remove) {
        isRemove = remove;
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public int getHP() {
        return HP;
    }

    public void setHP(int HP) {
        this.HP = HP;
    }

    public int getAp() {
        return ap;
    }

    public void setAp(int ap) {
        this.ap = ap;
    }
}
